﻿
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>

class Student
{
    public:
	    char* Name;
	    int Age;
	    float Score;

    public:
        void Show()
        {
            printf("hello world");
        }
};

int main()
{
	Student* stu1=new Student();
    // 为 Name 分配内存
    stu1->Name = new char[20];
    // 复制字符串到 Name
    strcpy_s(stu1->Name, 20, "Alice");
    // 访问并输出 Name
    std::cout << "Name: " << stu1->Name << std::endl;
    stu1->Show();
    // 释放 Name 分配的内存
    delete[] stu1->Name;
    // 释放 stu1 分配的内存
    delete stu1;
}


